<?php
	$id=$_GET['id'];
	//Xoa file hinh cua san pham "SELECT * FROM app t1 INNER JOIN category_app t2 ON t1.id = t2.app_id where t2.category_id='".$idCategory."'"
	$sql='select `image`,`category_id` from app t1 INNER JOIN category_app t2 ON t1.id = t2.app_id where `id`='.$id;
	$rs=mysqli_query($conn,$sql);
	$r=mysqli_fetch_assoc($rs);
	$UrlHinh=$r['image'];
	unlink('img/app/'.$UrlHinh);
	//Xoa san pham khoi CSDL
	$sql='delete from `app` where `id`='.$id;
	mysqli_query($conn,$sql);
	//Chuyen den trang san pham
	header('location:?mod=app&idCategory='.$r['category_id']);
?>